<template>
  <div>
  		<v-Header :item="headerMess"></v-Header>
      <v-Content>
				<v-Commission :item='commission' @toNext="people"></v-Commission>
				<!--<v-Recommend></v-Recommend>-->
				<v-Channel></v-Channel>
				<v-ExtendList></v-ExtendList>
      </v-Content>
      <v-Footer ></v-Footer>
  </div>
</template>
<script>
import Content from '@/components/ContentCenter'
import Footer from '@/components/Footer'
import Commission from '@/components/find/commission'
import Recommend from '@/components/find/recommend' 
import Channel from '@/components/find/channel'
import Level from '@/components/find/level'
import Header from '@/components/Header'
import ExtendList from '@/components/find/extendList'
import find from '@/api/find/index'
import { toast} from '@/util/index'

export default {
  data(){
    return {
    	headerMess:{
        src:"",
        headerText: '推广赚钱',
        right: ''
      },
      commission:{
      	money:"1200",
      	scale:"0.06%",
      	people:"0"
      }
  	}
    
  },
  components:{
	  'v-Footer':Footer,
	  'v-Content':Content,
	  'v-Commission':Commission,
	  'v-Recommend':Recommend,
	  'v-Channel':Channel,
	  'v-ExtendList':ExtendList,
	  'v-Level':Level,
	  "v-Header":Header,
  },
  methods:{
  	back() {
			this.$router.back(-1)
		},
		people(){
			this.$router.push({path:"/peopleNum"});
		}
    
  },
  mounted(){
		let senddata = {
			userId:window.localStorage.getItem("token"),
			plat:"mlj"
		}
	
		find.userEarningsRanking(senddata).then((res) => {
			if (res.data.code == 200) {
			 	this.commission.people=res.data.data.totalUser;
			 	this.$store.dispatch('saveRanks',res.data.data);
			 	
			 	
			} else if(res.data.code == 103){
				this.$router.push({path:'/realnameInfo'})
			} else {
				toast(res.data.message)
			}
		})
	},
  beforeRouteEnter(to,from,next){
    document.querySelector('title').innerText='谋略家'
      next()
  }
}
</script>

<style lang="less" scoped>
@import '../../less/config.less';
div{
	background: #0c101c;
	.header{
		padding:0 @p30;
		display: flex;
		justify-content:center;
		align-items: center;
		height:@hwrap;
		color:#fefeff;
		font-size:.48rem;
	}
}

</style>


